package com.wuhunyu.mapper;

import com.wuhunyu.entities.EduCourse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wuhunyu.entities.vo.CourseDetailVo;
import com.wuhunyu.entities.vo.CourseInfoVo;
import com.wuhunyu.query.EduCourseQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程 Mapper 接口
 * </p>
 *
 * @author wuhunyu
 * @since 2021-01-17
 */
public interface EduCourseMapper extends BaseMapper<EduCourse> {

    /**
     * 查询全部课程信息
     * @param courseId
     * @return
     */
    public Map<String, Object> selectCourseInfo(@Param("courseId") String courseId);

    /**
     * 按条件查询课程列表
     *
     * @param eduCourseQuery
     * @return
     */
    public List<Map<String, Object>> selectCourses(EduCourseQuery eduCourseQuery);

    /**
     * 按条件查询课程列表记录数
     * @param eduCourseQuery
     * @return
     */
    public Integer selectCoursesForCount(EduCourseQuery eduCourseQuery);

    /**
     * 根据课程id查询课程详情
     * @param courseId
     * @return
     */
    public CourseDetailVo selectCourseDetail(@Param("courseId") String courseId);

    /**
     * 根据课程id获取课程相关信息，提供给order订单
     * @param courseId
     * @return
     */
    public Map<String, Object> selectCourseForOrder(@Param("courseId") String courseId);

    /**
     * 根据课程id查询课程相关信息
     * @param courseId
     * @return
     */
    public CourseInfoVo selectCourseById(@Param("courseId") String courseId);

    /**
     * 批量修改课程发布状态
     * @param ids
     * @param status
     * @return
     */
    public Integer updateCourseStatus(@Param("ids") String[] ids, @Param("status") String status);

}
